home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBGRX100.ARJ / FRAMTEST.C < prev    next >
Text File  |  1992-04-10  |  3KB  |  79 lines

  1. /** 
  2.  ** FRAMTEST.C 
  3.  **
  4.  **  Copyright (C) 1992, Csaba Biegl
  5.  **    820 Stirrup Dr, Nashville, TN, 37221
  6.  **    csaba@vuse.vanderbilt.edu
  7.  **
  8.  **  This file is distributed under the terms listed in the document
  9.  **  "copying.cb", available from the author at the address above.
  10.  **  A copy of "copying.cb" should accompany this file; if not, a copy
  11.  **  should be available from where this file was obtained.  This file
  12.  **  may not be distributed without a verbatim copy of "copying.cb".
  13.  **  You should also have received a copy of the GNU General Public
  14.  **  License along with this program (it is in the file "copying");
  15.  **  if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  16.  **  Cambridge, MA 02139, USA.
  17.  **
  18.  **  This program is distributed in the hope that it will be useful,
  19.  **  but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.  **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21.  **  GNU General Public License for more details.
  22.  **/
  23.  
  24.  
  25. #include "test.h"
  26.  
  27. TESTFUNC(framtest)
  28. {
  29.     int x = GrSizeX();
  30.     int y = GrSizeY();
  31.     int ww = (x * 2) / 3;
  32.     int wh = (y * 2) / 3;
  33.     int c,ii,jj,bg;
  34.     GrFBoxColors bcolors,ocolors,icolors;
  35.     int wdt = ww / 150;
  36.     int bw = x / 16;
  37.     int bh = y / 16;
  38.     int bx,by;
  39.  
  40.     bcolors.fbx_intcolor = GrAllocColor(160,100,30);
  41.     bcolors.fbx_topcolor = GrAllocColor(240,150,45);
  42.     bcolors.fbx_leftcolor = GrAllocColor(240,150,45);
  43.     bcolors.fbx_rightcolor = GrAllocColor(80,50,15);
  44.     bcolors.fbx_bottomcolor = GrAllocColor(80,50,15);
  45.  
  46.     ocolors.fbx_intcolor = GrAllocColor(0,120,100);
  47.     ocolors.fbx_topcolor = GrAllocColor(0,180,150);
  48.     ocolors.fbx_leftcolor = GrAllocColor(0,180,150);
  49.     ocolors.fbx_rightcolor = GrAllocColor(0,90,60);
  50.     ocolors.fbx_bottomcolor = GrAllocColor(0,90,60);
  51.  
  52.     icolors.fbx_intcolor = bg = GrAllocColor(30,30,30);
  53.     icolors.fbx_bottomcolor = GrAllocColor(0,180,150);
  54.     icolors.fbx_rightcolor = GrAllocColor(0,180,150);
  55.     icolors.fbx_leftcolor = GrAllocColor(0,90,60);
  56.     icolors.fbx_topcolor = GrAllocColor(0,90,60);
  57.  
  58.     c = GrAllocColor(250,250,0);
  59.  
  60.  
  61.     for(ii = 0,by = -(bh / 3); ii < 17; ii++) {
  62.         for(jj = 0,bx = (-bw / 2); jj < 17; jj++) {
  63.         GrFramedBox(bx+2*wdt,by+2*wdt,bx+bw-2*wdt-1,by+bh-2*wdt-1,2*wdt,&bcolors);
  64.         bx += bw;
  65.         }
  66.         by += bh;
  67.     }
  68.  
  69.     GrFramedBox(ww/4-5*wdt-1,wh/4-5*wdt-1,ww/4+5*wdt+ww+1,wh/4+5*wdt+wh+1,wdt,&ocolors);
  70.     GrFramedBox(ww/4-1,wh/4-1,ww/4+ww+1,wh/4+wh+1,wdt,&icolors);
  71.  
  72.     GrSetClipBox(ww/4,wh/4,ww/4+ww,wh/4+wh);
  73.  
  74.     drawing(ww/4,wh/4,ww,wh,c,bg);
  75.     getkey();
  76.  
  77. }
  78.  
  79.